﻿@model List<TrackerEnabledDbContext.Common.Models.AuditLog>

@using GridMvc.Html
@helper  RenderActions(TrackerEnabledDbContext.Common.Models.AuditLog obj)
{
    if (obj.LogDetails.Count>0)
    { 
        @Html.ActionLink("LogDetails", "DbTraceDetails","Admin", new { id = obj.AuditLogId }, new { @class = "btn btn-info btn-xs" })
    <br />
    }
    else
    { 
    <p>No Details Present</p>
    }
}


@{
    ViewBag.Title = "DbTrace";
}

<h2>DbTrace</h2>

@Html.Grid(Model).Named("DbTraceGrid").Columns(columns =>
          {
              columns.Add(m => m.EventDateUTC).Titled("UTC DateTime").SetWidth(110).Filterable(true).Sortable(true);
              columns.Add(m => m.EventType).Titled("Event").Filterable(true).Sortable(true);
              columns.Add(m => m.TypeFullName).Titled("EntityType").Filterable(true).Sortable(true);
              columns.Add(m => m.RecordId).Titled("RecordID").Filterable(true).Sortable(true);
              columns.Add(m => m.UserName).Titled("User").Filterable(true).Sortable(true);
              columns.Add().Titled("Details").Encoded(false).Sanitized(false).RenderValueAs(m => RenderActions(m));
          }).WithPaging(50)

